﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows.Controls;
using RM.WinClient.RMServices;

namespace RM.WinClient
{
    public class Util
    {
        public static string FormatTime(int time)
        {
            return (time / 3600) > 0 ? (time / 3600) + " Hours " + ((time % 3600) / 60) + " Minutes " + ((time % 3600) % 60) + " Seconds" : (time / 60) > 0 ? (time / 60) + " Minutes " + (time % 60) + " Seconds" : time + " Seconds";
        }

        public static void LogMessage(OperationLog log)
        {
            LogServiceClient client = new LogServiceClient();
            log.CreatedDate = DateTime.Now;
            log.ModifiedDate = DateTime.Now;
            client.Log_Save(log);
        }
    }
}
